/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.qinyeit.serviceapp.entity.enums.ReceivePaymentType;
import lombok.Builder;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * ClassName: ReceivePayment <br/>
 * Function: 供应商收付款单据 <br/>
 * date: 2019-03-05 10:06:09 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="receive_payments")
public class ReceivePayment extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 供应商id 
    @Column(name="supplier_id")
	private Long supplierId = null;

	// 供应商名称 
    @Column(name="supplier_name", length = 300)
	private String supplierName = null;

	// 单号 
    @Column(name="no", length = 300)
	private String no = null;

	// 还/收款金额 
    @Column(name="amount",scale=2)
	private Double amount = null;

	// 优惠总金额 
    @Column(name="gift_amount",scale=2)
	private Double giftAmount = null;

	// 单据类型 
    @Column(name="type", length = 300)
	@Enumerated(EnumType.STRING)
	private ReceivePaymentType type = ReceivePaymentType.STOREIN;

	// 操作人 
    @Column(name="operator_name", length = 300)
	private String operatorName = null;

	// 操作时间 
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="operator_time")
	private Date operatorTime = null;


    @Tolerate
	public ReceivePayment() {
		
	}
    @Tolerate
	public ReceivePayment(Long id){
    	super.setId(id);
    }
	
	/**
	 * 获取供应商id
	 */
	public Long getSupplierId() {
		return this.supplierId;
	}

    /**
     * 设置供应商id
     */
	public ReceivePayment setSupplierId(Long supplierId) {
		this.supplierId = supplierId;
		return this;
	}

	/**
	 * 获取供应商名称
	 */
	public String getSupplierName() {
		return this.supplierName;
	}

    /**
     * 设置供应商名称
     */
	public ReceivePayment setSupplierName(String supplierName) {
		this.supplierName = supplierName;
		return this;
	}

	/**
	 * 获取单号
	 */
	public String getNo() {
		return this.no;
	}

    /**
     * 设置单号
     */
	public ReceivePayment setNo(String no) {
		this.no = no;
		return this;
	}

	/**
	 * 获取还/收款金额
	 */
	public Double getAmount() {
		return this.amount;
	}

    /**
     * 设置还/收款金额
     */
	public ReceivePayment setAmount(Double amount) {
		this.amount = amount;
		return this;
	}

	/**
	 * 获取优惠总金额
	 */
	public Double getGiftAmount() {
		return this.giftAmount;
	}

    /**
     * 设置优惠总金额
     */
	public ReceivePayment setGiftAmount(Double giftAmount) {
		this.giftAmount = giftAmount;
		return this;
	}


	/**
	 * 获取操作人
	 */
	public String getOperatorName() {
		return this.operatorName;
	}

    /**
     * 设置操作人
     */
	public ReceivePayment setOperatorName(String operatorName) {
		this.operatorName = operatorName;
		return this;
	}

	/**
	 * 获取操作时间
	 */
	public Date getOperatorTime() {
		return this.operatorTime;
	}

    /**
     * 设置操作时间
     */
	public ReceivePayment setOperatorTime(Date operatorTime) {
		this.operatorTime = operatorTime;
		return this;
	}

	public ReceivePaymentType getType() {
		return type;
	}

	public void setType(ReceivePaymentType type) {
		this.type = type;
	}
}
